﻿@using CultuRAM.Models


@{
    //var v1 = Session["UserName"];
    //var v2 = ViewBag.UserName;

    if (Session["UserName"] == "" || Session["UserName"] == null || Session["UserName"] == "Entrar")
    {
        if (!String.IsNullOrEmpty(ViewBag.UserName))
        {
            Session["UserName"] = ViewBag.UserName;
        }
        else
        {
            Session["UserName"] = "Entrar";
        }   
    }
        
}


<!-- INICIO MENU -->
<div id="menu_adm" class="navbar navbar-inverse" style="position: static;">
    <div class="navbar-inner" style="-webkit-border-radius: 0 !important; -moz-border-radius: 0 !important; border-radius: 0 !important;">
        <div class="container">
            <a class="btn btn-navbar" data-toggle="collapse" data-target=".navbar-inverse-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>
            <a class="brand" href="@Url.Action("Dashboard", "Home")">CultuRAM</a>
            <div class="nav-collapse collapse navbar-inverse-collapse">
                <ul class="nav">
                    <li id="li_home">
                        <a href="@Url.Action("Index", "Home")"><i class="fa fa-home" style="color: white"></i> Início </a>
                    </li>  
                    @if (WebSecurity.IsAuthenticated) 
                    {
                        <li id="li_dashboard" class=""><a href="@Url.Action("Dashboard", "Home")"><i class="fa fa-th" style="color: white"></i> Painel</a></li>
                        <li class="divider-vertical"></li>
                        <li id="li_entities" class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-building-o" style="color: white"></i> Entidades<b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li><a href="@Url.Action("Create", "Entity")"><i class="icon-plus"></i> Adicionar Novo</a></li>
                                <li><a href="@Url.Action("Index", "Entity")"><i class="icon-list"></i> Ver Lista</a></li>
                                <li class="divider"></li>
                                <li>
                                    <a href="@Url.Action("Index", "AccreditingRequest")"><i class="icon-list-alt"></i> Pedidos de Adesão</a>
                                </li>
                            </ul>
                        </li>
                        <li id="li_events" class="dropdown"> 
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-calendar" style="color: white"></i> Eventos<b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li><a href="@Url.Action("Create", "Event")"><i class="icon-plus"></i> Adicionar Novo</a></li>
                                <li><a href="@Url.Action("Index", "Event")"><i class="icon-list"></i> Ver Lista</a></li>
                                <li class="divider"></li>
                                <li><a href="@Url.Action("IndexHl", "Event")"><i class="icon-star"></i> Destaques</a></li>
                             @* <li><a href="@Url.Action("Alertas", "Temp")"><i class="icon-warning-sign"></i> Alertas</a></li>
                                <li><a href="@Url.Action("Bilheteira", "Temp")"><i class="icon-tag"></i> Bilheteira</a></li>*@
                                <li><a href="@Url.Action("Index", "Event")"><i class="icon-download-alt"></i> Exportação</a></li>

                            </ul>
                        </li>
                        <li id="li_users"><a href="@Url.Action("UserManager", "Account")"><i class="fa fa-users" style="color: white"></i> Utilizadores</a></li>
                        <li class="divider-vertical"></li>
                        <li id="li_statistics"><a href="@Url.Action("Index", "Statistics")"><i class="fa fa-pie-chart fa-fw" style="color: white"></i> Estatísticas</a></li>
                        <li id="li_parameters"><a href="@Url.Action("Index", "Parameters")"><i class="fa fa-cog" style="color: white"></i> Parâmetros</a></li>
                        <li class="divider-vertical"></li>
                        <li id="li_contacts"><a href="@Url.Action("Contactos", "Temp")"><i class="icon-envelope icon-white"></i> Contactos</a></li>
                        <li id="li_help"><a href="@Url.Action("Ajuda", "Temp")"><i class="fa fa-question-circle" style="color: white"></i> Ajuda</a></li>

                    @*                        <li>
        @if (WebSecurity.IsAuthenticated)
        {
            @Html.RouteLink("Editar","Default", new {controller = "Account", action = "Edit", userId = WebSecurity.CurrentUserId, roleId = Roles.GetRolesForUser(WebSecurity.CurrentUserName)})
        }
    </li>*@
                    }
                </ul>
                     
                <ul class="nav pull-right">
                    @* <form class="navbar-search" action="">
                        <input type="text" class="search-query span2" placeholder="Procurar">
                    </form>
                    <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>*@
                    <li id="li_session" class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-user  icon-white"></i> @Session["UserName"].ToString()<b class="caret"></b></a>
                        @if (WebSecurity.IsAuthenticated)
                        {
                            <ul class="dropdown-menu">
                                <li><a href="@Url.Action("Edit", "Account", new { id = WebSecurity.CurrentUserId, m = ViewBag.RoleId})"><i class="icon-edit"></i> Editar Perfil</a></li>
                                <li><a href="@Url.Action("Edit", "Account", new { id = WebSecurity.CurrentUserId, m = ViewBag.RoleId})"><i class='icon-lock'></i> Alterar Palavra-passe</a></li>
                                @*<li class="divider"></li>*@
                                @*<li><a href="@Url.Action("DashboardEN", "Home")"> <img alt="EN" src="~/Images/Icones/flag_en.png"style="width: 14px"/> Inglês </a> </li>*@ 
                                <li class="divider"></li>
                                <li>
                                    <a  class="" href="@Url.Action("LogOff1", "Account")"><i class="icon-off"></i> Sair</a>
                                </li>
                            </ul>        
                        }
                    </li>
                       
                </ul>
            </div><!-- /.nav-collapse -->
        </div>
    </div><!-- /navbar-inner -->
</div>
<!-- /navbar -->
 
    
<!-- FIM MENU -->


<script>
    //$(document).ready(function() {
    //    alert("menu");
    //    //e.preventDefault(); // prevent link click if necessary?

    //    var $thisLi = $(this).parent('li');
    //    var $ul = $thisLi.parent('ul');

    //    if (!$thisLi.hasClass('active')) {
    //        $ul.find('li.active').removeClass('active');
    //        $thisLi.addClass('active');
    //    }
    //});
</script>